﻿using System;
using System.Net;

namespace SCG.SolarVengeanceEngine.Orders
{
    public class EscortOrder : MapObjectOrder
    {
        //constructors        
        public EscortOrder(SVGame game, OrderType ot, SVMapObject svm, int x, int y)
            : base(game, ot, svm)
        {
            OffsetX = x;
            OffsetY = y;
        }
        public EscortOrder(SVGame game, OrderType ot, SVTokenizer tok)
            : base(game, ot, tok)
        {
            OffsetX = tok.TokenInt;
            OffsetY = tok.TokenInt;
        }

        //The relative position against the target
        public int OffsetX { get; set; }

        public int OffsetY { get; set; }

        //Persistence
        public override string Persist()
        {
            SVTokenizer tok = new SVTokenizer(Game);
            tok.Tokenize(OffsetX, OffsetY);
            return base.Persist() + tok.Result;
        }

    }
}
